#include "cjson/jsonutils.h"
#include <stdio.h>

string getString(cJSON *json, const char *key, const char *val)
{
    cJSON * temp = NULL;
    if(json == NULL){
        return val;
    }
    return ((temp = cJSON_GetObjectItem(json, key)) == NULL)?/*printf("not set %s,use %s\n", key, val),*/val:(temp->valuestring==NULL)?"":temp->valuestring;
}

int getInt(cJSON *json, const char *key, int val)
{
    cJSON * temp = NULL;
    if(json == NULL){
        return val;
    }
    return ((temp = cJSON_GetObjectItem(json, key)) == NULL)?/*printf("not set %s,use %d\n", key, val),*/val:temp->valueint;
}

double getDouble(cJSON *json, const char *key, double val)
{
    cJSON * temp = NULL;
    if(json == NULL){
        return val;
    }
    return ((temp = cJSON_GetObjectItem(json, key)) == NULL)?/*printf("not set %s,use %f\n", key, val),*/val:temp->valuedouble;
}

int aaa()
{
return -1;
}
